# -*- coding: utf-8 -*-
import scrapy
from bzmh.items import BzmhItem


class BzmhwordsSpider(scrapy.Spider):
    name = 'bzmhwords'
    allowed_domains = ['baozoumanhua.com/text']
    '''
    generate ?page=x
    '''
    for x in range(1,2):
    	start_urls = ['http://baozoumanhua.com/text?page='+str(x)]

    def parse(self, response):
    	'''
    	get words

    	'''
    	item = BzmhItem()

    	textxp = response.xpath('//div[@class="article-content"]')

    	for word in textxp:
    		

    		item['words'] = word.xpath('./h4/a/text()').extract()[0]

    		yield item

    		





        
